home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / circuits / spice2g6.z / spice2g6 / spice / Fortran / subnam.f < prev    next >
Encoding:
Text File  |  1989-02-03  |  1.7 KB  |  58 lines

  1.       subroutine subnam(loce)
  2.       implicit double precision (a-h,o-z)
  3. c
  4. c     this routine constructs the names of elements added as a result of
  5. c subcircuit expansion.  the full element names are of the form
  6. c                  name.xn. --- xd.xc.xb.xa
  7. c where 'name' is the nominal element name, and the 'x'*s denote the
  8. c sequence of subcircuit calls (from top or circuit level down through
  9. c nested subcircuit calls) which caused the particular element to be
  10. c added.  at present, spice restricts all element names to be 8 charac-
  11. c ters or less.  therefore, the name used consists of the leftmost 8
  12. c characters of the full element name, with the rightmost character
  13. c replaced by an asterisk ('*') if the full element name is longer than
  14. c 8 characters.
  15. c
  16. c spice version 2g.6  sccsid=blank 3/15/83
  17.       common /blank/ value(200000)
  18.       integer nodplc(64)
  19.       complex cvalue(32)
  20.       equivalence (value(1),nodplc(1),cvalue(1))
  21. c
  22. c
  23.       data ablank, aper, astk / 1h , 1h., 1h* /
  24. c
  25. c  construct subcircuit element name
  26. c
  27.       if (nodplc(loce-1).eq.0) go to 100
  28.       locve=nodplc(loce+1)
  29.       loc=loce
  30.       nchar=0
  31.       sname=ablank
  32.       achar=ablank
  33.    10 locv=nodplc(loc+1)
  34.       elname=value(locv)
  35.       do 20 ichar=1,8
  36.       call move(achar,1,elname,ichar,1)
  37.       if (achar.eq.ablank) go to 30
  38.       if (nchar.eq.8) go to 40
  39.       nchar=nchar+1
  40.       call move(sname,nchar,achar,1,1)
  41.    20 continue
  42.    30 loc=nodplc(loc-1)
  43.       if (loc.eq.0) go to 60
  44.       if (nchar.eq.8) go to 40
  45.       nchar=nchar+1
  46.       call move(sname,nchar,aper,1,1)
  47.       go to 10
  48. c
  49. c  name is longer than 8 characters:  flag with asterisk
  50. c
  51.    40 call move(sname,8,astk,1,1)
  52.    60 value(locve)=sname
  53. c
  54. c  finished
  55. c
  56.   100 return
  57.       end
  58.